import request from '@/utils/request'

export const login = (data) => {
    return request({
        url: '/app/login',
        method: 'post',
        data
        
    })
}

export const register = (data) => {
    return request({
        url: '/app/register',
        method: 'post',
        data
    })
}

export const getCateList = () => {
    return request({
        url: '/music/category/list',
        method: 'get'
    })
}
export const updateUserCate = (ids:[]) => {
    return request({
        url: `/music/cateRelation/batch/${ids}`,
        method: 'post',
        
    })
}

export const searchSongs = (keyword:string) => {
    return request({
        url: `/app/index/search/${keyword}`,
        method: 'get'
    })
}

export const getSwiperList = () => {
    return request({
        url: '/music/carousel/list',
        method:'get'
    })
}

export const getNewSongs = () => {
    return request({
        url: '/music/music/new',
        method: 'get'
    })
}

export const getHotSongs = () => {
    return request({
        url: '/music/music/hot',
        method: 'get'
    })
}

export const uploadUserBehavior = (musicId) => {
    return request({
        url: `/app/index/stat/${musicId}`,
        method: 'get',
    })
}

export const likeMusic = (musicId) => {
    return request({
        url: `/app/like/${musicId}`,
        method: 'get',
    })
}

export const getUserBehaviorByMusic = (musicId) => {
    return request({
        url: '/app/userBehavior/'+musicId,
        method: 'get',
    })
}
export const getRecommend = () => {
    return request({
        url: '/app/recommend',
        method: 'get',
    })
}